﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_Master/AdminMaster2.master" AutoEventWireup="true" 
CodeFile="openLotteryNews.aspx.cs" Inherits="openLotteryNews" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="apply">
  <div class="apply2">
   <%--<uc_left_m:left_menu ID="left_m1" runat="server" />--%>
    <div class="myul_r">
      <div class="mod_pad4">
<div class="hd_admin"><em class="ulimg_admin">开奖公告</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<a href="openLotteryAdd.aspx">添加</a> 
</div> 
<div class="admin_tab_box1"><br /><label class="bold green1">请选择种类：</label><asp:dropdownlist runat="server" id="caipiaoType" AutoPostBack="true"
              onselectedindexchanged="caipiaoType_SelectedIndexChanged"  >
    <asp:ListItem Value="1">双色球</asp:ListItem> 
<asp:ListItem Value="2">大乐透</asp:ListItem> 
<asp:ListItem Value="3">排列三</asp:ListItem> 
<asp:ListItem Value="4">排列五</asp:ListItem> 
<asp:ListItem Value="5">福彩3D</asp:ListItem> 
<asp:ListItem Value="6">七星彩</asp:ListItem> 
<asp:ListItem Value="7">七乐彩</asp:ListItem>
    </asp:dropdownlist> 
          <div class="clear"></div>
       <div class="coupons">
            <table class="w top20" width="1060" border="0" cellspacing="0" cellpadding="0"  id="www_zzjs_net">
              <tr>
              <td style=" width:300px;">期数</td>
                <td style="width:460px;">开奖号码</td>   
                  <td style="width:460px;">开奖时间</td>   
                <td style="width:460px;">操作</td>
              </tr>            
              <%if (lottery != null && lottery.Count > 0)
                { %>
                <%for (int k = 0; k < lottery.Count; k++)
                  { %>
              <tr >
                 
                <td style=" width:300px;">第<%=lottery[k].LotteryQS%>期</td>
                <td style=" width:460px;"><%=lottery[k].LotteryNo%></td>     
                <td style=" width:460px;"><%=lottery[k].openTime%></td>              
                <td style=" width:460px;">
                 <a href="openLotterySelect.aspx?type=<%=lottery[k].LotteryType%>&qs=<%=lottery[k].LotteryQS%>" >查看中奖人员</a> &nbsp;<a href="openLotterEdit.aspx?t=edit&id=<%=lottery[k].id%>" >编辑</a>
              </td>
               
              </tr>
              <%} %>
              <%}
                else
                { %>
             <tr>
                <td style=" width:1060px;"><div class='no_data'>^_^&nbsp;&nbsp;没有符合条件的数据！</div></td>
              </tr> 
              <%} %>             
            </table>
          </div>
          
                  <div id="changpage" style="text-align:center"> </div> 
        </div>
          
          

      </div>
    </div> 
  </div> 
</div> 
<script language="javascript" type="text/javascript">
    var obj, j;
    var page = 0;
    var nowPage = 0; //当前页
    var listNum = 6; //每页显示<ul>数
    var PagesLen; //总页数
    var PageNum = 4; //分页链接接数(5个)
    onload = function () {
        obj = document.getElementById("www_zzjs_net").getElementsByTagName("tr");
        j = obj.length
        PagesLen = Math.ceil(j / listNum);
        upPage(0)
    }
    function upPage(p) {
        nowPage = p
        //内容变换
        for (var i = 0; i < j; i++) {
            obj[i].style.display = "none"
        }
        for (var i = p * listNum; i < (p + 1) * listNum; i++) {
            if (obj[i]) obj[i].style.display = "block"
        }
        //分页链接变换
        strS = '<a href="###" onclick="upPage(0)">首页</a>  '
        var PageNum_2 = PageNum % 2 == 0 ? Math.ceil(PageNum / 2) + 1 : Math.ceil(PageNum / 2)
        var PageNum_3 = PageNum % 2 == 0 ? Math.ceil(PageNum / 2) : Math.ceil(PageNum / 2) + 1
        var strC = "", startPage, endPage;
        if (PageNum >= PagesLen) { startPage = 0; endPage = PagesLen - 1 }
        else if (nowPage < PageNum_2) { startPage = 0; endPage = PagesLen - 1 > PageNum ? PageNum : PagesLen - 1 } //首页
        else { startPage = nowPage + PageNum_3 >= PagesLen ? PagesLen - PageNum - 1 : nowPage - PageNum_2 + 1; var t = startPage + PageNum; endPage = t > PagesLen ? PagesLen - 1 : t }
        for (var i = startPage; i <= endPage; i++) {
            if (i == nowPage) strC += '<a href="###" style="color:red;font-weight:700;" onclick="upPage(' + i + ')">' + (i + 1) + '</a> '
            else strC += '<a href="###" onclick="upPage(' + i + ')">' + (i + 1) + '</a> '
        }
        strE = ' <a href="###" onclick="upPage(' + (PagesLen - 1) + ')">尾页</a>  '
        strE2 = nowPage + 1 + "/" + PagesLen + "页" + "  共" + j + "条"
        document.getElementById("changpage").innerHTML = strS + strC + strE + strE2
    }
</script>
</asp:Content>